home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / unicode_stop < prev    next >
Encoding:
Text File  |  2007-01-22  |  1003 b   |  43 lines

  1. #!/bin/sh
  2. # stop unicode
  3.  
  4. if [ ! -e /proc/self/fd/0 ] ; then
  5.    echo "Not setting UTF-8 mode; cannot check console type." >&2
  6.    echo "  please ensure /proc is mounted." >&2
  7.    exit 1
  8. fi
  9.  
  10. readlink /proc/self/fd/0 | grep -q  -e /dev/vc -e '/dev/tty[^p]' -e /dev/console
  11. if [ $? -eq 1 ]; then
  12.     echo "Not a virtual terminal : Not setting UTF-8 mode." >&2
  13.     exit 1
  14. fi
  15.  
  16. if [ -n "$previous" ] && [ -n "$runlevel" ] || [ "$runlevel" = "S" ]; then
  17.     RUN_FROM_INIT="yes"
  18. fi
  19.  
  20. if ! /usr/bin/vt-is-UTF8 --quiet && [ "$RUN_FROM_INIT" != "yes" ]; then
  21.     echo "unicode_stop: Already in byte-mode" >&2
  22.     exit 0
  23. fi
  24.  
  25. kbd_mode -a
  26.  
  27. # set DEVICE_PREFIX depending on devfs/udev
  28. if [ -d /dev/vc ]; then
  29.     DEVICE_PREFIX="/dev/vc/"
  30.     else
  31.     DEVICE_PREFIX="/dev/tty"
  32. fi
  33.  
  34. NUM=`fgconsole --next-available`
  35. NUM=`expr ${NUM} - 1`
  36. # Cope with being called in S mode before getty starts the remaining
  37. # VTs:
  38. [ $NUM -eq 1 ] && NUM=6
  39. for vc in `seq 1 ${NUM}`
  40. do 
  41.    /bin/echo -n -e '\033%@' > ${DEVICE_PREFIX}${vc}
  42. done
  43.